package com.woniuxy.topic.controller;

import com.woniuxy.pojo.Mail;
import com.woniuxy.pojo.TopicMail;
import com.woniuxy.topic.service.TopicService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class TopicController {

    @Resource
    TopicService topicService;

    @RequestMapping("/mytopic")
    @ResponseBody
    public void topicSend(@ModelAttribute("mail") TopicMail mail){
        topicService.sendMessage(mail);
    }
}
